Field of the Invention
The present invention relates to an analog/digital converter for converting analog data acquired by measuring an object, and more particularly, to an analog/digital converter that may easily and accurately perform “coincidence detection” between A/D converted data and a reference value, and a micro-computer in which the analog/digital converter is installed.
An analog/digital converter (hereinafter simply referred to as an A/D converter) is widely used in many devices for monitoring various analog data, for example, for detecting battery voltage in a personal computer. Japanese Patent Application Publication 5-134807 discloses an exemplary configuration of such a conventional A/D converter. As apparent from FIG. 11 in the publication, a conventional A/D converter 200 includes an A/D converting unit 201 for converting analog data obtained by measuring an object to digital data, a memory circuit 202 for storing the converted digital data, and a data storing register 203 for storing comparing data. The conventional A/D converter 200 further includes a volume comparing circuit 204 for comparing a data volume of data stored in the memory circuit 202 with a data volume of data stored in the comparing data storing register 203, and an interrupt request signal generating circuit 205 for outputting an interrupt request signal in accordance with a comparison result of the data volume comparing circuit 204.
The comparison of data volumes between the memory data and the comparing data is executed at the A/D converting unit side in the conventional A/D converter 200. An interrupt request signal is generated and supplied to a CPU at a time only when a predetermined data volume is satisfied by the comparison of data volumes. To execute the direct data volume comparison between stored data and comparing data in the comparing circuit 204, the conventional A/D converter expects such a condition that the measured input analog voltages may gradually increase or reduce up to a predetermined voltage for performing an expected process in a micro-computer.
However, in actual cases, the conventional A/D converter 200 can not sufficiently perform so-called “coincidence detection” between the converted digital data and the comparing data, since input analog voltages may suddenly be greatly varied. Accordingly, it is impossible for the conventional A/D converter 200 to detect a critical moment or a time when the A/D converted data coincides with the comparing data. As explained later in FIG. 5, an A/D conversion in the conventional A/D converter may frequently skip over an accurate timing for the comparing data value, because it cannot detect a critical moment or a time when coincidence between converted data and comparing data occurs. Consequently, since the conventional A/D converter cannot generate an interrupt request signal to a CPU at a necessary time when input analog data coincide with comparing data, CPU can not perform an expected process at a proper timing. Thus, the conventional A/D converter and a micro-computer in which it is installed have many problems and defects for detecting coincidence between converted digital data and the comparing data.
FIG. 12 shows another configuration of the conventional A/D converter as disclosed in Japanese Patent Application Publication 2002-261609. As illustrated in FIG. 12, the conventional A/D converter 300 includes an A/D converting unit 301, a converted data storing register 302 for storing digital data converted in A/D converting unit 301, a comparing register 303 for storing a predetermined reference value for a base of operation in CPU 305 and a comparing circuit 304 for comparing digital data with the predetermined reference value. The A/D converter 300 generates an interrupt request signal to CPU 305 in accordance with a result of comparison in the comparing circuit 304.
Similar to the conventional A/D converter 200 explained in regard to FIG. 11, the conventional A/D converter 300 is also intended to directly compare data volumes in the comparing circuit 304. Thus, the comparing circuit 304 compares whether a data volume of the converted data is larger or smaller than a data volume of the predetermined value. Accordingly, both conventional A/D converters perform a direct data volume comparison between the converted data and the reference value by directly comparing all bits of the converted data with all bit of the reference value. Consequently, both of the conventional A/D converters disclosed in FIGS. 11 and 12 have the same problems and defects that they cannot detect a critical moment or a time when the converted data coincides with a reference value. Thus, it is impossible for the conventional A/D converter to easily perform coincidence detection at a critical moment. Accordingly, the conventional CPU cannot operate at a necessary timing.